package csc.fresher.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import csc.fresher.dao.PeriodTypeDao;
import csc.fresher.entity.PeriodType;
import csc.fresher.service.PeriodTypeService;

@Service
public class PeriodTypeServiceImpl implements PeriodTypeService {
	@Autowired
	PeriodTypeDao periodTypeDao;

	@Override
	public PeriodType getPeriodTypeByID(int periodTypeID) {
		PeriodType periodType = null;
		if (periodTypeDao != null) {
			periodType = periodTypeDao.getPeriodTypeByID(periodTypeID);
		} else
			System.err.println("period type dao is null");
		return periodType;
	}
	
	@Override
	public List<PeriodType> getAllTypes() {
		List<PeriodType> periodTypes = null;
		if (periodTypeDao != null) {
			periodTypes = periodTypeDao.getAllPeriodTypes();
		} else
			System.err.println("period type dao is null");
		return periodTypes;
	}

}
